# $Id: PKGBUILD 87498 2013-04-01 20:19:22Z bpiotrowski $
# Maintainer:  Bartłomiej Piotrowski
# Contributor: Brad Fanella <bradfanella@archlinux.us>
# Contributor: Allan McRae <allan@archlinux.org>
# Contributor: Tomas A. Schertel <tschertel@gmail.com>

pkgname=cherrytree
pkgver=0.29.4
pkgrel=1
pkgdesc='Hierarchical note taking application featuring rich text and syntax highlighting'
arch=('any')
url='http://www.giuspen.com/cherrytree/'
license=('GPL')
depends=('pygtksourceview2' 'hicolor-icon-theme' 'desktop-file-utils')
install=$pkgname.install
source=(http://www.giuspen.com/software/$pkgname-$pkgver.tar.xz)
sha256sums=('464ed343bf210930724f40feec88d370789d048ed90ad8a76b8eee397aaca0eb')

build() {
	cd $srcdir/$pkgname-$pkgver

	# python2 fix
	for file in $(find . -name '*.py') cherrytree; do
 		echo "Applying python2 fix for ${file}"
 		sed -i 's_/usr/bin/env python_/usr/bin/env python2_' ${file}
 	done
}
	
package() {
	cd $srcdir/$pkgname-$pkgver
  	python2 setup.py install --root=$pkgdir/ --optimize=1
}
